﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Yule8xWechat.Withdraw.Default" %>

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>提现</title>
    <link rel="stylesheet" type="text/css" href="../Skin/Theme/Css/comm.css" />
    <link rel="stylesheet" type="text/css" href="../Skin/Theme/Css/icon.css" />
    <link rel="stylesheet" type="text/css" href="../Skin/Theme/Css/my.css" />
    <link rel="stylesheet" type="text/css" href="../Skin/Theme/Css/agent.css" />
    <script src="../Skin/Theme/Js/flexible_css.js" type="text/javascript" charset="utf-8"></script>
    <script src="../Skin/Theme/Js/flexible.js" type="text/javascript" charset="utf-8"></script>
    <style type="text/css">
		</style>
</head>
<body>
    <script src="/Skin/Theme/Js/jquery_2.1.3.js" type="text/javascript" charset="utf-8"></script>
    <script src="/Skin/Plugins/DialogLib/layer-v3.0.1/layer.js" type="text/javascript"></script>
    <div class="content">
        <!--提现顶部菜单-->
        <div class="topmenu">
            <ul>
                <li class="topmenuli"><a href="History.aspx?user_id=<%=user_id %>"><span class="txmenuimg">
                    <img src="../Skin/Theme/images/cash/tixianjilu.png"></span><span class="txmenutxt">提现记录</span></a></li>
                <li class="topmenuli"><a href="Profile.aspx?user_id=<%=user_id %>"><span class="txmenuimg">
                    <img src="../Skin/Theme/images/cash/xiugaiziliao.png"></span><span class="txmenutxt">修改提现资料</span></a></li>
            </ul>
        </div>
        <div class="clear"></div>
        <!--余额信息-->
    <form method="post" action="Default.aspx?user_id=<%=user_id %>">
        <div class="baseinfo">
            <ul>
                <li>
                    <div class="totaltixian">累计提现 <a class="t-r"><%=pageData.total_withdraw_amount %>元</a></div>
                </li>
                <li>
                    <div class="totalyue">当前可提现余额   <a class="t-r"><%=pageData.blance %>元</a></div>
                </li>
                <li>
                    <div class="basetext"><span class="anameicon">
                        <img src="../Skin/Theme/images/cash/tixianjine.png"></span><span class="anametext">提现金额</span><span class="anameinput"><input type="text" name="amount" id="amount" placeholder="请输入提现金额" required="required" data-blance="<%=pageData.blance %>" /></span></div>
                </li>
                <li>
                    <div class="basetext"><span class="aareatext">提现到</span><span class="anameinput" style="color: #999; font-size: 1.5em;"><%=bankcard %></span></div>
                </li>
            </ul>
        </div>

        <!--提现手机验证-->
        <div class="baseinfo">
            <ul>
                <li>
                    <div class="basetext"><span class="anameicon">
                        <img src="../Skin/Theme/images/agent/agentphone.png"></span><span class="anametext">手机号码</span><span class="anameinput" style="color: #999; font-size: 1.5em;"><%=mobile_mask %></span></div>
                </li>
                <li>
                    <div class="basetext"><span class="anameicon">
                        <img src="../Skin/Theme/images/agent/code.png"></span><span class="anametext">验	证	码</span><span class="acodeinput"><input type="text" name="yzm" placeholder="请输入验证码" /></span><span class="agetcode"><a id="btn-get-sms-code" href="../PublicServices/SMSServices.aspx?uid=<%=wxUser.user_id %>" data-sec="<%=smscountdown %>">获取验证码</a></span></div>
                </li>
            </ul>
        </div>
        <div class="clear"></div>
        <!--提现事项-->
        <div class="regagenttip">
            <div class="tiptext">为避免资金丢失<a class="t-r">提现采用人工审核机制</a></div>
            <div class="tiptext">提现验证码将发送到<a class="t-r">注册代理使用的手机号</a></div>
            <div class="tiptext">若有疑问请联系<a class="t-r">QQ:1730151367</a></div>

        </div>

        <!--提现按钮-->
        <div class="regbutton"><span class="regbtn"><button type="submit">确认提现</button></span></div>
        <input type="hidden" name="action" value="submit" />
        </form>
    </div>
	
    <script type="text/javascript">
        function validateform() {
            var amount = $('#amount').val();
            if (amount.length < 1 || isNaN(amount)) {
                layer.msg('提现金额无效!');
                return false;
            }
            if ($('input[name="yzm"]').val().length < 1) {
                layer.msg('验证码未填写!');
                return false;
            }
            return true;
        }
        $('#amount').change(function () {
            var $this = $(this);
            var number = $this.val() * 1;
            var blance = $this.data('blance') * 1;
            if (number > blance) {
                $this.val(blance);
            }
        })
        $('#btn-get-sms-code').click(function () {
            var $this = $(this);
            if ($this.parent().hasClass('fanbai')) {
                return false;
            }
            /*
            var mobile = $('[name="mobile"]').val();
            if (mobile.length < 1) {
                layer.msg('手机号码未填写!');
                return false;
            }
            */
            $('#btn-get-sms-code').data('reset', false);
            var url = $this.attr('href');
            $.get(url, { "type": "withdrawconfirm", "mobile": '' }, function (data) {
                layer.msg(data);
                if (data.indexOf('成功') < 0) {
                    $('#btn-get-sms-code').data('reset', true);
                }
            })
            $this.parent().addClass('fanbai');
            button_countdown();
            return false;
        })
        // 按钮倒计时功能
        function button_countdown() {
            var sec = $('#btn-get-sms-code').data('sec');
            if (!sec) {
                sec = 60;
            }
            var text = $('#btn-get-sms-code').text();
            var intv = setInterval(btn_countdown_fnc, 1000);
            var reset;
            function btn_countdown_fnc() {
                reset = $('#btn-get-sms-code').data('reset');
                sec--;
                if (sec < 1 || reset) {
                    clearInterval(intv);
                    $('#btn-get-sms-code').text(text).parent().removeClass('fanbai');
                    return;
                }
                $('#btn-get-sms-code').text(text + '(' + sec + ')');
            }
        }
    </script>
</body>
</html>
